package spring.chatroom.java_chatroom.common.config.timer;

import org.jetbrains.annotations.NotNull;

import java.time.Duration;
import java.time.LocalTime;

public class Task implements Comparable<Long> {
    Runnable runnable;
    Long delay;

    /**
     *
     * @param runnable
     * @param delay 毫秒
     */
    public Task(Runnable runnable, Long delay) {
        this.runnable = runnable;
        this.delay = delay;
    }

    @Override
    public int compareTo(@NotNull Long o) {
        return (int) (this.delay - o);
    }
}
